<!DOCTYPE html>
<html>
  <head>
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js"></script>
    <script>document.write('<script src="' + (localStorage.getItem('lang') || 'en') + '/i18n.js"><\/script>')</script>
  </head>
  <body>
    <div id="content">
    </div>
    <input type="button" value="en" name="en" />
    <input type="button" value="fr" name="fr" />
    <script>
      $('<div>').text(window.i18n['colors'].red()).appendTo('#content');
      $('<div>').text(window.i18n['colors'].blue()).appendTo('#content');
      $('<div>').text(window.i18n['colors'].green()).appendTo('#content');
      $('<div>').text(window.i18n['sub/folder/plural'].test({NUM: 1})).appendTo('#content');
      $('<div>').text(window.i18n['sub/folder/plural'].test({NUM: 2})).appendTo('#content');

      $('input').click(function(e){
        e.preventDefault();
        var lang = $(e.target).attr('name');
        localStorage.setItem('lang', lang);
        location.reload();
      });
    </script>
  </body>
</html>
